package edu.usc.tweetool.hibernate;

/**
 * UserTopicId entity. @author MyEclipse Persistence Tools
 */

public class UserTopicId implements java.io.Serializable {

	// Fields

	private String userName;
	private String topic;

	// Constructors

	/** default constructor */
	public UserTopicId() {
	}

	/** full constructor */
	public UserTopicId(String userName, String topic) {
		this.userName = userName;
		this.topic = topic;
	}

	// Property accessors

	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getTopic() {
		return this.topic;
	}

	public void setTopic(String topic) {
		this.topic = topic;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof UserTopicId))
			return false;
		UserTopicId castOther = (UserTopicId) other;

		return ((this.getUserName() == castOther.getUserName()) || (this
				.getUserName() != null
				&& castOther.getUserName() != null && this.getUserName()
				.equals(castOther.getUserName())))
				&& ((this.getTopic() == castOther.getTopic()) || (this
						.getTopic() != null
						&& castOther.getTopic() != null && this.getTopic()
						.equals(castOther.getTopic())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getUserName() == null ? 0 : this.getUserName().hashCode());
		result = 37 * result
				+ (getTopic() == null ? 0 : this.getTopic().hashCode());
		return result;
	}

}